<template>
	<div class="page">
		<c-title :hide="false" text="血糖记录"></c-title>
		<div class="content">
			<div class="list" v-for="(item,index) in list" :key="index" @click="tjbgdetail(item.id)">
				<div class="item">
					<div class="lable">
						凌晨：
					</div>
					<div class="val">
						{{item.lingchen}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						空腹：
					</div>
					<div class="val">
						{{item.kongfu}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						早餐后：
					</div>
					<div class="val">
						{{item.zaocanhou}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						午餐前：
					</div>
					<div class="val">
						{{item.wucanqian}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						午餐后：
					</div>
					<div class="val">
						{{item.wucanhou}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						晚餐前：
					</div>
					<div class="val">
						{{item.wancanqian}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						晚餐后：
					</div>
					<div class="val">
						{{item.wancanhou}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						睡前：
					</div>
					<div class="val">
						{{item.shuiqian}}
					</div>
				</div>
				<div class="item">
					<div class="lable">
						时间：
					</div>
					<div class="val">
						{{item.time}}
					</div>
				</div>
			</div>
		</div>
		<div class="add" @click="add" >
			添加血糖记录
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				list:[]
			}
		},
		activated() {
			this.getlist()
		},
		methods:{
			tjbgdetail(id){
				this.$router.push(this.fun.getUrl("xtjldetail", {}, {id}));
			},
			add(){
				this.$router.push(this.fun.getUrl("addxtjl", {}, { }));
			},
			getlist(){
				$http
					.post("plugin.hft-hospital.api.jiankang.get-xuetang-list", {
						
					})
					.then(response => {
						console.log(response)
						if (response.result === 1) {
							this.list = response.data
							
						} else {
							Toast(response.msg);
						}
					})
					.catch(error => {
						console.log(error);
					});
			}
		}
	}
</script>

<style scoped lang="scss">
.page{
	.content{
		.list{
			background-color: #fff;
			padding: 0.5rem;
			margin-bottom: 0.5rem;
			border: 0.01rem solid #ccc;
			.item{
				font-size: 1rem;
				display: flex;
				.lable{
					width: 4rem;
					text-align: left;
				}
			}
		}
	}
	.add{
		background-color:#169BD5 ;
		color: #fff;
		line-height: 2rem;
		position: fixed;
		width: 100%;
		margin: 0 auto;
		bottom:0;
	}
}
</style>